#include "ObstructionData.h"




void ObstructionData::initSprite()
{
	sprites = new Sprites(this->rect);
	sprites->initSpriteHandler(*(GameDeviceSingleton::getInstance()->getSpriteHandler()));
	sprites->addSprite(_STATE_MAP_STAGE1_GRASS_1, ObstructionDataFactory::getSpriteId(this->type));
	sprites->setState(_STATE_MAP_STAGE1_GRASS_1);
}

ObstructionData::ObstructionData(int id, int type, double x, double y)
{
	this->id = id;
	this->type = type;
	// initialize rectangle
	this->rect = ObstructionDataFactory::getRect(type, x, y);
	this->rect->Vx = this->rect->Vy = 0;
	// intialize sprites
	this->initData();
}

void ObstructionData::initData()
{
	this->initSprite();
}

void ObstructionData::initSpriteHandler(LPD3DXSPRITE spriteHandler)
{
	sprites->initSpriteHandler(spriteHandler);
}
